package reposetery

import (
	"Redbook/redbook/internal/Domain"
	"Redbook/redbook/internal/reposetery/dao"
	"context"
)

type Loginrepo interface {
	Login(ctx context.Context, man Domain.User) error
}

type loginrepo struct {
	Dao dao.LoginDao
}

func NewLogin(dao dao.LoginDao) Loginrepo {
	return &loginrepo{Dao: dao}
}

func (l *loginrepo) Login(ctx context.Context, use Domain.User) error {
	return l.Dao.Creat(ctx, dao.User{
		ID:     use.ID,
		Passwd: use.Passwd,
	})
}
